package com.owl.app;

import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.MenuItem;

import com.owl.app.cms.util;

public class OptionMenu {
	
	public Activity act;
	
	public OptionMenu(){
		
	}
	
	public OptionMenu(Activity actTmp){
		act = actTmp;
	}
	
	public boolean initSelected(MenuItem item){
		Log.v("getPackageCodePath", act.getPackageCodePath());
		Log.v("getLocalClassName	", act.getLocalClassName());
		Log.v("getPackageName", act.getPackageName());
		Log.v("getPackageResourcepath", act.getPackageResourcePath());
		
		util cmsutil = new util();
		Activity actNext;
		Intent intent;
		
		switch(item.getItemId()){
		case R.id.goHome:
			cmsutil.goActivity(act, act.getPackageName() + ".AppSite");
			return true;
		case R.id.goSearch:
			cmsutil.goActivity(act, act.getPackageName() + ".MallList");
			return true;
		case R.id.goMyZone:
			cmsutil.goActivity(act, act.getPackageName() + ".MyZone");
			return true;
		case R.id.goNotice:
			cmsutil.goActivity(act, act.getPackageName() + ".MainSite");
			return true;
		case R.id.goMap:
			cmsutil.goActivity(act, act.getPackageName() + ".OwlMap");
			//((owllab) act.getApplication()).setCompanyMapState(act.getResources().getString(R.string.company_address));
			return true;
		case R.id.goVideo:
			cmsutil.goActivity(act, act.getPackageName() + "Sitevideo");
			return true;
		case R.id.goSong:
			cmsutil.goActivity(act, act.getPackageName() + ".MainSite");
			return true;
		case R.id.goLogin:
			cmsutil.goActivity(act, act.getPackageName() + "LoginAct");
			return true;
		case R.id.goInfo:
			actNext = cmsutil.findAct(act, act.getPackageName() + ".MainSite");
			intent = new Intent(act, actNext.getClass());
			intent.putExtra("tabId", "tab2");
			act.startActivity(intent);
			return true;
		case R.id.goCategory:
			actNext = cmsutil.findAct(act, act.getPackageName() + ".MainSite");
			intent = new Intent(act, actNext.getClass());
			intent.putExtra("tabId", "tab3");
			act.startActivity(intent);
			return true;
		default:
			return true;
		}
		
	}
}
